package com.skzh.web.controller.customized;

import com.skzh.common.annotation.Log;
import com.skzh.common.core.controller.BaseController;
import com.skzh.common.core.domain.AjaxResult;
import com.skzh.common.core.page.TableDataInfo;
import com.skzh.common.enums.BusinessType;
import com.skzh.customized.domain.PcCustomized;
import com.skzh.customized.service.IPcCustomizedService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author zr
 * @Description pc定制化控制器
 * @Date 2025/3/21 15:52
 */
@RestController
@RequestMapping("/customized/pcInfo")
public class PcController extends BaseController {

    @Autowired
    private IPcCustomizedService pcCustomizedService;


    /**
     * 查询pc定制基本信息
     */
    @ApiOperation(value = "查询pc定制基本信息")
    @GetMapping("/list")
    public TableDataInfo list(PcCustomized pcCustomized) {
        List<PcCustomized> list = pcCustomizedService.selectPcList(pcCustomized);
        return getDataTable(list);
    }

    /**
     * 修改pc定制基本信息
     */
    @ApiOperation(value = "修改pc定制基本信息")
    @Log(title = "pc定制基本信息基本信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody PcCustomized pcCustomized) {
        return toAjax(pcCustomizedService.updatePc(pcCustomized));
    }

}
